package com.ticket.sass.admin.dto.output.commodity.category;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.ticket.sass.admin.model.KeyInfoModel;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

/**
 * @author ywb
 * @date 2024-03-23 15:24
 */
@Data
@ApiModel
public class CommodityCategoryListOutput {
    @ApiModelProperty(value = "商品分类ID")
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;
    
    @ApiModelProperty(value = "类名")
    private String name;
    
    private Integer sort;
    
    @JsonIgnore
    @ApiModelProperty(value = "图标")
    private String icon;
    
    @ApiModelProperty(value = "图标")
    private KeyInfoModel iconModel;
    
    public KeyInfoModel getIconModel() {
        return new KeyInfoModel(icon);
    }
}
